/*
暂时先支持单窗口，glfw和opengl在window中初始化
*/
#pragma once
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <string>


namespace kanon
{
    struct WindowInfo
    {
        uint32_t width;
        uint32_t height;
        std::string title;
    };

    class Window
    {
    private:
        GLFWwindow* window;
        uint32_t width;
        uint32_t height;
        std::string title;
        double frame_time;

    public:
        Window(const WindowInfo& info);
        ~Window();
        bool Initialize();

        bool WindowClosed();
        bool Update();
        bool SwapBuffers();

        double GetFrameTime();
        uint32_t GetWidth() const { return width; }
        uint32_t GetHeight() const { return height; }
        GLFWwindow* GetHandle() const { return window; }
    };
}
